package assist.datastore.parser;

import java.io.File;
import java.io.IOException;

import assist.domain.model.PlayerAlias;

public class NHLPlayerAliasCSVParser extends NHLCSVParser<PlayerAlias>
{

    private static final long serialVersionUID = 1L;

    public NHLPlayerAliasCSVParser(File csvFile, Integer lineNum)
            throws IOException
    {
        super(csvFile, lineNum);
    }

    @Override
    protected PlayerAlias parseObject(String[] tokens)
    {
        PlayerAlias pa = new PlayerAlias();
        if (tokens==null || tokens.length < 2 || tokens[0] == null || tokens[1] == null)
        {
            return null;
        }
        pa.setName(tokens[1]);
        pa.setPlayerId(new Long(tokens[0]));
        
        return pa;
    }

}
